package se.liu.oschi129.font.fontspace;

import java.awt.Font;
import java.util.Hashtable;

/**
 * This is a class contains all fonts in the game.
 * Use FontSpace.add() to add a font into the font space and FontSpace.get()
 * to return it from the collection. 
 * 
 * @author oschi129
 */
public abstract class FontSpace {

	// This hashtable is a container for all fonts
	private static Hashtable<String,FontResource> space = new Hashtable<String,FontResource>();
	
	/** Adds a font into the FontSpace */
	public static void add(String name, FontResource font) {
		space.put(name, font);
	}
	
	/** Removes a font from the FontSpace */
	public static void remove(String name) {
		space.remove(name);
	}
	
	/** Returns a font from the fontspace with a given size */
	public static Font get(String name, float size) {
		return space.get(name).getFont(size);
	}
	
}
